RtAllocateLocalMemory
RtAllocateLocalMemory allocates memory from a pre-allocated RTSS local memory pool to avoid SRI activity if allocating memory from the Windows memory pool.
Syntax
PVOID RtAllocateLocalMemory(
ULONG Size
);
Parameters
Size
An unsigned long specifying the number of bytes to allocate.
Return Value
A pointer to the memory if the function succeeds, a NULL pointer if the function fails
Remarks
RtAllocateLocalMemory allocates memory in the virtual address space of the process, backed by non-paged memory. Since RtAllocateLocalMemory allocates memory from a pre-allocated RTSS memory pool, this is a deterministic memory allocation call and can be called in a shutdown handler.
NOTE: If the RTSS memory pool has not been created yet or if the amount of free memory in the pool is not enough for the requested Size, there is Windows interaction involved in an RtAllocateLocalMemory call and the deterministic feature is lost. To avoid that, call RtQueryLocalMemory first to make sure there is enough free memory in RTSS memory pool.
NOTE: If the RTSS local memory pool has not been created yet, RtAllocateLocalMemory will initialize the pool with a size equal to the greater of the Size parameter or the size of the local memory pool configured via the RTX64 Control Panel. If the amount of free memory in the pool is not enough for the requested Size, RtAllocateLocalMemory will implicitly expand the pool with a size equal to the max{ LocalMemoryExpandSize, Size }. You can disable this implicitly expand feature by settings in the RTX64 Control Panel.
Applications must link to rtapi.lib.
Requirements
Minimum Supported Version | RTX64 2013 |
Header | Rtapi.h |
Library | RtApi.lib (Windows), Rtx_Rtss.lib (RTSS) |
See Also: